#pragma once
#include "model/RealTimeDataFields.h"
#include <string>
#include "MysqlMgr.h"
class IRealTimeDataMgr {
public:
	virtual ~IRealTimeDataMgr() = default;
	virtual bool UpsertRealTimeDataTable(const std::string& device_id, const model::RealTimeDataFields& data) = 0;
	virtual bool InsertHistoryDataTable(const std::string& device_id, const model::RealTimeDataFields& data) = 0;
};

class RealTimeDataMgr_DB : public IRealTimeDataMgr {
public:
	bool UpsertRealTimeDataTable(const std::string& device_id, const model::RealTimeDataFields& data) override {
		MysqlMgr::GetInstance()->UpsertRealtimeData(data);
		
		return true;
	}

	bool InsertHistoryDataTable(const std::string& device_id, const model::RealTimeDataFields& data) override {

		MysqlMgr::GetInstance()->InsertHistoryData(data);
		return true;
	}
};